<!DOCTYPE html>
<html lang="it">
    <head>
        <?= HTMLManager::get_head_content() ?>
        <title>
            <?php
            if (isset($_GET['type'])) {
                if ($_GET['type'] == ACTION_LAST_GALLERIES) {
                    echo 'Ultime Gallerie Aggiunte :: salesianichioggia.it';
                } else if ($_GET['type'] == ACTION_PATH) {
                    echo $fd[count($fd) - 1] . ' - Cartella :: salesianichioggia.it';
                } else if ($_GET['type'] == ACTION_GALLERY) {
                    echo $gallery->title . ' :: salesianichioggia.it';
                }
            } else {
                echo 'Gallerie Fotografiche ' . $year . ' :: salesianichioggia.it';
            }
            ?>
        </title>
        <!-- <link href="http://www.salesianichioggia.it/js/lightbox/css/lightbox.css" rel="stylesheet" /> -->
        <style>
            .fb-like-box {
                background-color: #FFF !important;
            }

            .gallery-title {
                font-size: 3em !important;
                border-bottom: 5px solid #94c451;
                margin-bottom: 20px;
                padding: 0px 0px 10px 0px;
            }
            .folder, .gallery {
                background: none !important;
                box-shadow: none !important;
                -webkit-box-shadow: none !important;
                -moz-box-shadow: none !important;
                border: none !important;
            }
            .folder p, .gallery p{
                text-align: center !important;
                font-weight: bold;
            }
            
            h1 {
                margin-bottom: 10px;
            }

        </style>
        <script type="text/javascript">
            $(document).ready(function(){
                
            });
        </script>
        <!-- <script src="http://www.salesianichioggia.it/js/lightbox/js/lightbox.js"></script> -->
        <!-- Fresco -->
        <script type="text/javascript" src="http://www.salesianichioggia.it/js/fresco/js/fresco/fresco.js"></script>
        <link rel="stylesheet" type="text/css" href="http://www.salesianichioggia.it/js/fresco/css/fresco/fresco.css"/>
    </head>
    <body>
        <?= HTMLManager::get_header() ?>
        <div class="container">
            <div class="row">
                <?php
                if (isset($_GET['type'])) {
                    if ($_GET['type'] == ACTION_GALLERY) {
                        ?>
                        <div class="span12">
                            <?= $gallery->get_html_view() ?>
                        </div>
                    <?php } else if ($_GET['type'] == ACTION_PATH) {
                        ?>
                        <div class="span12">
                            <ul class="breadcrumb">
                                <li><a href="http://www.salesianichioggia.it/gallerie/">Home</a> <span class="divider">/</span></li>
                                <?php
                                    $link = "http://www.salesianichioggia.it/gallerie/";
                                    for ($i = 0; $i < count($fd); $i++) {
                                        if ($i == count($fd) - 1) {
                                            echo '<li class="active">' . $fd[count($fd) - 1] . '</li>';
                                        } else {
                                            $link .= $fs[$i] . '/';
                                            echo '<li><a href="' . $link . '">' . $fd[$i] . '</a> <span class="divider">/</span></li>';
                                        }
                                    }
                                ?>
                            </ul>
                            <h1 class="gallery-title"><?= $fd[count($fd) - 1] ?></h1>
                            <?php
                            if (count($folders) > 0) {
                                ?>
                                <div class="row">
                                    <div class="span12">
                                        <ul class="thumbnails">
                                            <?php foreach ($folders as $name => $description) { ?>
                                                <li class="span2">
                                                    <a href="<?= $name ?>/">
                                                        <div class="thumbnail folder">
                                                            <img src="http://www.salesianichioggia.it/img/gallery_folder.png" alt="<?= 'Cartella - ' . $description ?>" />
                                                            <div class="caption">
                                                                <p><?= $description ?></p>
                                                            </div>
                                                        </div>
                                                    </a>
                                                </li>
                                                <?php
                                            }
                                            ?>
                                        </ul>
                                    </div>
                                </div>
                            <?php
                            }
                            if (count($galleries) > 0) {
                                ?>
                                <div class="row">
                                    <div class="span12">
                                        <h1>Gallerie in <?= $fd[count($fd) - 1] ?></h1>
                                        <ul class="thumbnails">
                                        <?php foreach ($galleries as $gallery) { ?>
                                                <li class="span2">
                                                    <a href="<?= $gallery->get_seo_link() ?>">
                                                        <div class="thumbnail gallery">
                                                            <img src="http://www.salesianichioggia.it/img/gallery.png" alt="Galleria" />
                                                            <div class="caption">
                                                                <p><?= $gallery->title ?></p>
                                                            </div>
                                                        </div>
                                                    </a>
                                                </li>
                                                <?php
                                            }
                                            ?>
                                        </ul>
                                    </div>
                                </div>
                            <?php } ?>

                        </div>
                        <?php
                    }
                } else if (isset($_GET['year'])) {
                    
                } else {
                    ?>
                    <div class="span12">
                        <ul class="breadcrumb">
                            <li class="active">Home</li>
                        </ul>
                        <h1 class="gallery-title">Gallerie Fotografiche</h1>
                        <ul class="thumbnails">
    <?php foreach ($folders as $name => $description) { ?>
                                <li class="span2">
                                    <a href="<?= $name ?>/">
                                        <div class="thumbnail folder">
                                            <img src="http://www.salesianichioggia.it/img/gallery_folder.png" alt="<?= 'Cartella - ' . $description ?>" />
                                            <div class="caption">
                                                <p><?= $description ?></p>
                                            </div>
                                        </div>
                                    </a>
                                </li>
                                <?php
                            }
                            ?>
                        </ul>
                    </div>
                    <?php
                }
                ?>
            </div>   
        </div>

<?= HTMLManager::get_footer() ?>
        <script src="http://www.salesianichioggia.it/bootstrap/js/bootstrap-transition.js" type="text/javascript"></script>
        <script src="http://www.salesianichioggia.it/bootstrap/js/bootstrap-tooltip.js" type="text/javascript"></script>
        <script src="http://www.salesianichioggia.it/bootstrap/js/bootstrap-popover.js" type="text/javascript"></script>
    </body>
</html>